package com.symaster.backups.frame.element.menu;

import javax.swing.*;
import java.awt.*;

/**
 * @author yinmiao
 * @version 2024/1/23
 */
public class MyTest {

    public static void main(String[] args) {

        TopMenu topMenu = new TopMenu();
        topMenu.addItem(new TopMenu.Item("k1", "JFrame"));
        topMenu.addItem(new TopMenu.Item("k2", "SetPreferredSize"));
        topMenu.addItem(new TopMenu.Item("k3", "Hello World"));
        topMenu.addItem(new TopMenu.Item("k4", "test3"));

        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        panel.add(topMenu);

        JFrame jFrame = new JFrame("MyTest");
        jFrame.setContentPane(panel);
        jFrame.setPreferredSize(new Dimension(500, 70));
        jFrame.pack();
        jFrame.setVisible(true);
    }
}
